package com.fc.redap.entity;

import com.fc.redap.validate.AddGroup;
import com.fc.redap.validate.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@ApiModel(value = "OrgEntity", description = "机构组织对象")
public class OrgEntity  implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID", allowEmptyValue = true)
    private Long id;

    @ApiModelProperty(value = "name")
    @NotBlank(message="机构名称不能为空")
    private String name;

    @ApiModelProperty(value = "ORG_CODE")
    @NotBlank(message="机构代码不能为空")
    private String orgCode;

    @ApiModelProperty(value = "CITY")
    @NotBlank(message="城市不能为空")
    private String city;

    @ApiModelProperty(value = "AREA", allowEmptyValue = true)
    private String area;

    @ApiModelProperty(value = "ADDRESS")
    private String address;

    @ApiModelProperty(value = "PROVINCE")
    @NotBlank(message="省份不能为空")
    private String province;

    @ApiModelProperty(value = "ORG_TYPE", notes="OWNER=管理公司, AGENT=代理商, CHANNEL=渠道商, RENT=租赁商")
    @NotBlank(message="机构类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String orgType;

    @ApiModelProperty(value = "LEVEL", allowEmptyValue = true)
    private String level;

    @ApiModelProperty(value = "status", notes="0=INACTIVE, 1=ACTIVE, 2=EXPIRED")
    @NotNull(message="机构状态不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer status;

    @ApiModelProperty(value = "CONTACT")
    private String contact;

    @ApiModelProperty(value = "CONTACT_PHONE")
    private String contactPhone;

    @ApiModelProperty(value = "CREATE_TIME")
    @NotNull(message="创建时间不能为空",  groups = {AddGroup.class})
    private Date createTime;

    @ApiModelProperty(value = "UPDATE_TIME")
    @NotNull(message="更新时间不能为空",  groups = {UpdateGroup.class})
    private Date updateTime;
}
